package com.tpp.scheduler.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tpp.comm.pojo.TpTask;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface TaskMapper extends BaseMapper<TpTask> {

    /**
     * 修改任务状态
     * @param id
     * @param status
     */
    @Update("update tp_task set status=#{status},update_time=now() where id=#{id}")
    void updateStatus(@Param("id")String id,@Param("status")Integer status);

    @Update("update tp_task set error_msg=#{errorMsg},status=2,update_time=now() where id=#{id}")
    void updateErrorMsg(@Param("id")String id,@Param("errorMsg")String errorMsg);

}
